<script setup>
import { inject } from 'vue';
import EarnMoney from './EarnMoney.vue'

// 从共享数据中取值
const money = inject("myMoney");
</script>

<template>
 <button @click="money -= 500">花钱</button>

 <EarnMoney></EarnMoney>
</template>


<style scoped></style>